<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
 <input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo"
	cellspacing="1">
	<tr class="li_1">
		<td   colspan="4" class="t_bar2">实验区基本情况</td>
		
	</tr>
	<tr class="li_2">
		<td   align="right" width="20%"><span class="color_red">*</span>实验区名称：</td>
		<td  colspan="3">
			<input id="zh_title" name="proposal/zh_title" label="实验区名称" type="text" required class="input_css required maxlength:100"  style="width: 725px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />"/> 
		</td>
	</tr>
	<%-- <tr class="li_1">
		<td   align="right" width="20%">项目类别：</td>
		<td  colspan="3">
			<x:out select="$xmlData/data/proposal/grant_name" /> 
		</td>
	</tr> --%>
	<tr class="li_1">
		<td width="20%" align="right" >申报单位：</td>
		<td colspan="3">&nbsp;<span name="organizations/organization[0]/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" />
		    </span>
		</td>
	</tr>
	<tr class="li_2">
		<td   align="right" width="20%"><span class="color_red">*</span>实验区所在地：</td>
		<td  colspan="3">
			<input name="proposal/address" label="实验区所在地" type="text" required class="input_css required"  style="width: 725px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/address" />"/> 
		</td>
	</tr>
	<%--<tr class="li_1">
	<td align="right"><span class="color_red">*</span>研发形式：</td>
	<td   colspan="3" valign="middle">
	<label> <input type="radio" class="do " id="advant_01" style="vertical-align: middle;" name="research" label="独立研发" value="01" /><span style="vertical-align: middle;">独立研发</span></label> 
	<label> <input type="radio" class="do " id="advant_02" style="vertical-align: middle;" name="research" label="合作研发" value="02" /><span style="vertical-align: middle;">合作研发</span></label> 
	<label> <input type="radio" class="do " id="advant_03" style="vertical-align: middle;" name="research" label="引进消化吸收研发" value="03" /><span style="vertical-align: middle;">引进消化吸收研发</span></label>
	<label> <input type="radio" class="do " id="advant_04" style="vertical-align: middle;" name="research" label="其他" value="04" /><span style="vertical-align: middle;">其他</span></label>
	<input type="hidden" name="proposal/research_value" id="research_value" class="required" value="<x:out select="$xmlData/data/proposal/research_value" />" label="研发形式" /> 
	<input type="hidden" name="proposal/research_name" id="research_name" value="<x:out select="$xmlData/data/proposal/research_name" />" label="研发形式" /></td>
	</tr> 
	<tr class="li_2">
	<td  align="right" ><span class="color_red">*</span>申报领域：</td>
	<td colspan="3">
			 <c:set var="grantCode"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
			 
			<c:set var="domain_value"><x:out select="$xmlData/data/proposal/domain_value" /></c:set>
			<cpt:checkbox key="grant_domain" name="domain" repeatColumn="4"  sqlParamVal="{'grant_code':'${grantCode}'}"></cpt:checkbox>
			<input type="hidden" name="proposal/domain_value" class="required"  value="${domain_value}" label="申报领域">
			<input type="hidden" name="proposal/domain_name" value="<x:out select="$xmlData/data/proposal/domain_name" />">
			
			<c:set var="sub"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
			<c:set var="domain">{'id':'<x:out select="$xmlData/data/proposal/domain_value" />','name':'<x:out select="$xmlData/data/proposal/domain_name" />'}</c:set>
          	<cpt:tree key="domain1" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${domain}"  label="学科名称"
          		id="domain" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue3" sqlParamVal="{grant_code:	${sub}}"/>
	        <input id="domain_value" type="hidden" name="proposal/domain_value" class="required" label="学科名称" value="<x:out select="$xmlData/data/proposal/domain_value" />"/>
            <input id="domain_name" type="hidden" name="proposal/domain_name"  value="<x:out select="$xmlData/data/proposal/domain_name" />"/>
			 <c:if test="${grantCode =='109' }">
			<input type="hidden" name="proposal/technosphere_value" id="technosphere_value" value="01" /> 
			<input type="hidden" name="proposal/technosphere_name" id="technosphere_name" value="工业" />
			</c:if>
			<c:if test="${grantCode =='110' }">
			<input type="hidden" name="proposal/technosphere_value" id="technosphere_value" value="02" /> 
			<input type="hidden" name="proposal/technosphere_name" id="technosphere_name" value="农业" />
			</c:if>
			<c:if test="${grantCode =='111' }">
			<input type="hidden" name="proposal/technosphere_value" id="technosphere_value" value="03" /> 
			<input type="hidden" name="proposal/technosphere_name" id="technosphere_name" value="社会发展" />
			</c:if> 
	</td>
	</tr>
	<tr class="li_1">
	<td align="right"><span class="color_red">*</span>学科名称：</td>
   <td  colspan="3">
          	<c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />','name':'<x:out select="$xmlData/data/proposal/subject_name" />'}</c:set>
          	<cpt:tree key="medically" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${subject}"  label="学科名称"
          		id="subject" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2" />
	        <input id="subject_code" type="hidden" name="proposal/subject_code" class="required" label="学科名称" value="<x:out select="$xmlData/data/proposal/subject_code" />"/>
            <input id="subject_name" type="hidden" name="proposal/subject_name"  value="<x:out select="$xmlData/data/proposal/subject_name" />"/>
   </td>
	</tr> --%>
	<tr class="li_1">
		<td align="right"><span class="color_red">*</span>归口管理部门：</td>
		<td colspan="3">
			<c:set var="recomend_org"><x:out select="$xmlData/data/proposal/recomend_org_value" /></c:set>
			<c:set var="sqOrgCode"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/></c:set>
			<cpt:select id="recomend_org" sqlParamVal="{currentorgcode:${sqOrgCode }}"  key="proposal_tjbm"  value="${recomend_org}" onChange="initControlValue(this.id);"></cpt:select>
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required" value="${recomend_org}" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
	</tr>
	<tr class="li_2" >
	<td align="right"><span class="color_red">*</span>实验区领导小组负责人：</td>
	<td><input  name="proposal/xyq_leading_name" label="实验区领导小组负责人" type="text"  class="input_css required" maxlength="20" value="<x:out select="$xmlData/data/proposal/xyq_leading_name" />"/></td>
	<td align="right" width="120px;"><span class="color_red">*</span>职务：</td>
	<td><input  name="proposal/xyq_leading_position" label="实验区领导小组负责人的职务" type="text"  class="input_css required" maxlength="20" value="<x:out select="$xmlData/data/proposal/xyq_leading_position" />"/></td>
	</tr>
	<tr class="li_1">
		<td align="right"><span class="color_red">*</span>实验区管理机构名称：</td>
		<td colspan="3">
			<input id="xyq_management_title" name="proposal/xyq_management_title" label="实验区管理机构名称" type="text" class="input_css required maxlength:100"  style="width: 725px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/xyq_management_title" />"/> 
		</td>
	</tr>
	<tr class="li_2">
	<td align="right"><span class="color_red">*</span>实验区管理机构负责人：</td>
	<td><input  name="proposal/xyq_management_name" label="实验区管理机构负责人" type="text"  class="input_css required"  maxlength="20" value="<x:out select="$xmlData/data/proposal/xyq_management_name" />"/></td>
	<td align="right" width="120px;"><span class="color_red" >*</span>职务：</td>
	<td><input  name="proposal/xyq_management_position" label="实验区管理机构负责人的职务" type="text"  class="input_css required" maxlength="20" value="<x:out select="$xmlData/data/proposal/xyq_management_position" />"/></td>
	</tr>
	<tr class="li_1">
		<td align="right"><span class="color_red">*</span>详细通讯地址：</td>
		<td colspan="3">
			<input id="xyq_management_address" name="proposal/xyq_management_address" label="详细通讯地址" type="text" class="input_css required"  style="width: 725px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/xyq_management_address" />"/> 
		</td>
	</tr>
	<tr class="li_2">
		<td align="right"><span class="color_red">*</span>邮政编码：</td>
		<td >
			<input id="xyq_postalcode" name="proposal/xyq_postalcode" label="邮政编码" type="text" class="input_css required " maxlength="30" value="<x:out select="$xmlData/data/proposal/xyq_postalcode" />"/> 
		</td>
		<td align="right"><span class="color_red">*</span>联系电话：</td>
		<td >
			<input id="xyq_telphone" name="proposal/xyq_telphone" label="联系电话" type="text" class="input_css required " maxlength="30" value="<x:out select="$xmlData/data/proposal/xyq_telphone" />"/> 
		</td>
	</tr>
	<tr class="li_1">
	<td  align="right" ><span class="color_red">*</span>开始日期：</td>
		<td >
			<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className="required date  dateCompare:end_date" label="项目开始日期" ></cpt:date> 
		</td>
		<td  align="right"  width="120px;"><span class="color_red">*</span>结束日期：</td>
		<td>
			<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" className="required date" label="项目结束日期"  value="${end_date}" ></cpt:date> 
		</td>
	</tr>
	<tr class="li_2">
	    <td  align="right"  width="20%"><span class="color_red">*</span>申报日期：</td>
		<td colspan="3">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className=" required date" label="申报日期"></cpt:date> 
		</td>
	</tr>
	</table>
<div class="t_bar"><span class="color_red" >*</span>实验区有关工作成绩</div>
<table  id="tbAchievement" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
			<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center"  width="10%">选择</th>
						<th class="TblHead" align="center"  width="10%">序号</th>
						<th class="TblHead" align="center"  width="30%">专项工作名称或荣誉称号</th>  
				      <th class="TblHead" align="center"  width="20%">批准机关及文号</th> 
				      <th class="TblHead" align="center"  width="20%">命名时间</th> 			        
					</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none" align="center">
						<td align="center">&nbsp;
							<input type="radio" class="radiobutton" name="selAchievement" >
						</td>
						<td align="center">&nbsp;
							<span name="achievements|list[0]@seq_no" >[index]</span> 
						</td>
						<td align="center">
							<input type="text" name="achievements|list[0]|protocolname" label="专项工作名称或荣誉称号" class="required input_text" maxlength="50" style="width:80%"/>
						</td>						
						<td align="center">
							<input type="text" name="achievements|list[0]|hzdx" label="批准机关及文号"  class="required input_text"  maxlength="50" style="width:80%"/>
						</td> 
						<td align="center">
						   <input  id="achievements_date_[0]" name="achievements|list[0]|date" label="命名时间" value="" class="required input_text date" style="width:70%"/>
						</td>
					</tr>				
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/achievements/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						<td align="center">&nbsp;
							<input type="radio" class="radiobutton" name="selAchievement" >
						</td>
						<td align="center">&nbsp;
							<span name="achievements/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<input type="text" name="achievements/list[${flag}${index}]/protocolname"  label="专项工作名称或荣誉称号" style="width:80%"   class="required input_text" value="<x:out select="$list/protocolname" />" maxlength="50"/>
						</td>	
						<td >
							<input type="text" name="achievements/list[${flag}${index}]/hzdx"  label="批准机关及文号"   style="width:80%"  class="required input_text" value="<x:out select="$list/hzdx" />"  maxlength="50"/>
						</td> 
						<td align="center">
							<c:set var="date" scope="page"><x:out select="$list/date"/></c:set>
							<input  id="milestone_date_[${flag}${index}]" value="${date}" label="命名时间" name="achievements/list[${flag}${index}]/date" class="required date"  style="width:70%" /> 
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("tbAchievement");
					</script>
	   </tbody>
				</table>
					<table width="98%" align="center" border="0">
					<tr><td>
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="addNewRow('tbAchievement');showDateTag('tbAchievement');try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tbAchievement','selAchievement')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tbAchievement','selAchievement')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tbAchievement','实验区有关工作成绩');">
					</td></tr>
				</table>
<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="personal_information">
<tr>
		<td class="t_bar2" colspan="8">人员信息</td>
	</tr>
<tr>
		<td align="right" ><span class="color_red">*</span>项目联系人：</td>
		<td  >
			<input size="12"  name="proposal/contact_psn_cname" label="人员信息-->项目联系人" type="text" required class="input_css required"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>联系电话：</td>
		<td  >
			<input  name="proposal/contact_psn_tel" label="人员信息-->联系电话" type="text" required class="input_css required"   maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_tel" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>联系手机：</td>
		<td  >
			<input  name="proposal/contact_psn_mobile" label="人员信息-->联系手机" type="text" required maxlength="11" required class="input_css required mobile"   maxlength="20" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>电子邮箱：</td>
		<td  >
			<input  name="proposal/contact_psn_email" label="人员信息-->电子邮箱" type="text" required class="input_css required email"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/> 
		</td>
	</tr>
	<tr>
		<td  align="right">项目负责人：</td>
		<td>
		    <span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		</td>
		<td  align="right">联系电话：</td>
		<td  >
		<span name="proposal/fzr_tel" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
		</td>
		<td  align="right">联系手机：</td>
		<td  >
		<span name="proposal/fzr_mobile" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
		<td  align="right">电子邮箱：</td>
		<td  >
		<span name="proposal/fzr_mail"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
	</tr> 
</table>
<script type="text/javascript">
$(function(){
	cydw('org1');
	cydw('org2');
})
function cydw(id){
	var count =0 ;
	$("#"+id).find("input[type='text']").each(function(){
		if($.trim($(this).val()) != ''){
			count +=1;
		}
	});
	if(count != 0){
		$("#"+id).find("input[type='text']").each(function(){
			$(this).addClass("required");
		});
		$("#"+id).find("span[id^='color']").each(function(){
			$(this).css('display','');
		});
	}else{
		$("#"+id).find("input[type='text']").each(function(){
			$(this).removeClass("required");
	});
		$("#"+id).find("span[id^='color']").each(function(){
			$(this).css('display','none');
		});
	}
}

function setProjectPlace(op){
	var address = $("#address_value").val();
	if(op) address = '${address}';
	$("#address_name_other").removeClass("required");
	if(address == '02'){
		$("#address_name_other_span").show();
		$("#address_name_other").css("display","");
		$("#address_name_other").addClass("required");
	}else{
		$("#address_name_other_span").hide();
		$("#address_name_other").removeClass("required");
		$("#address_name_other").val("");
	}
}
function initTreeValue2CallBack(){
	cydw('org1');
	cydw('org2');
}
function setEmptyValueForTree(id){
	$("#"+id).val("");
	$("#"+id+"_hideId").val("");
	$("#"+id+"_hideName").val("");
	$("#"+id+"_code").val("");
	$("#"+id+"_value").val("");
	$("#"+id+"_name").val("");
	$("#"+id + ",[name$='/"+id+"_code']" + ",[name$='/"+id+"_name'],[name$='/"+id+"_value']").val("");
	$("#sqdm").val("");
	cydw('org1');
	cydw('org2');
}

</script>

